﻿using System;
using System.Text;
using System.Windows.Forms;

namespace PowerGui.AddOn.Interfaces
{
    /// <summary>
    /// The interface for script editors. 
    /// </summary>
    public interface IScriptEditor
    {
        /// <summary>
        /// The GUID used to identify this script editor within the collection
        /// of script editors maintained by the <see cref="IPowerGui"/> implementor.
        /// </summary>
        Guid Id { get; }
        /// <summary>
        /// The current file opened in the script editor.
        /// </summary>
        string FileName { get; }
        /// <summary>
        /// The encoding of the document loaded into the script editor.
        /// </summary>
        /// <remarks>
        /// If you wish to change the encoding of the document before saving it,
        /// change this property's value.
        /// </remarks>
        Encoding DocumentEncoding { get; set; }
        /// <summary>
        /// Shows the snippet selector.
        /// </summary>
        void ShowSnippetSelector();
        /// <summary>
        /// Loads the specified file name into the editor.
        /// </summary>
        /// <param name="filename">The file name to load.</param>
        void LoadFile(string filename);
        /// <summary>
        /// Saves the current editor to the <see cref="FileName"/> file.
        /// </summary>
        void SaveFile();
        /// <summary>
        /// Saves the current editor document into the specified file name.
        /// </summary>
        /// <remarks>
        /// The document is saved with the encoding specified with <see cref="DocumentEncoding"/>.
        /// </remarks>
        /// <param name="filename">The file name to save the document to.</param>
        void SaveFile(string filename);
        /// <summary>
        /// Returns the <see cref="Control"/> used to display this script editor.
        /// </summary>
        Control EditorControl { get; }
        /// <summary>
        /// Shows the Print dialog for the editor.
        /// </summary>
        void ShowPrintDialog();
        /// <summary>
        /// Shows the print page setup dialog for this editor.
        /// </summary>
        void ShowPageSetupForm();
        /// <summary>
        /// 
        /// </summary>
        IEditorFontAndColors FontAndColors { get; }
    }
}
